import * as zrender from 'zrender';
import {
  personColumnWidth,
  timeScaleHeight,
  personColumnZIndex,
} from '../../config';

export function drawPersonColumnTitle(zr: any) {
  // 绘制人员列标题
  const titleBackground = new zrender.Rect({
    shape: {
      x: 0,
      y: 0,
      width: personColumnWidth,
      height: timeScaleHeight,
    },
    style: {
      fill: '#e8e8e8',
    },
    z: personColumnZIndex,
    silent: true,
  });
  zr.add(titleBackground);
  const titleText = new zrender.Text({
    style: {
      text: '人员信息',
      x: personColumnWidth / 2,
      y: timeScaleHeight / 2,
      align: 'center',
      verticalAlign: 'middle',
      fontSize: 14,
      fontWeight: 'bold',
      fill: '#333',
    },
    z: personColumnZIndex,
    silent: true,
  });
  zr.add(titleText);
}
